/**
 * render column overwrite querylist4ext.js
 * 
 * @param {}
 *            value
 * @param {}
 *            cellmeta
 * @param {}
 *            record
 * @param {}
 *            rowIndex
 * @param {}
 *            columnIndex
 * @param {}
 *            store
 * @return {}
 */
function renderHeader(value, cellmeta, record, rowIndex, columnIndex, store) {
	var resultString = String
			.format(
					'<b><a href="javascript:void(0);" onclick="javascript:editobjcore(\'{0}\');">{1}</a></b>',
					record.data.ID, value);

	var fieldName = Ext.getCmp(querykey).getColumnModel()
			.getDataIndex(columnIndex);
	if (fieldName == 'OPEN') {
		var resultString = String
				.format(
						'<b><a target="_blank" href="'
								+ context
								+ '/system/objectcreator.do?method=view&key=APP_LXDJ&id={0}">查阅</a></b>',
						record.data.ID, value);

		return resultString;
	} else if (fieldName == 'XFTIME' || fieldName == 'XJTIME') {
		return formatDate(value);
	} else if (fieldName == 'LXSTATUS') {
		if (value == '0') {
			return '<center>否</center>';
		} else if (value == '1') {
			return '<center>是</center>';
		}
	} else if (fieldName == 'BLSTATUS') {
		if (value == '0') {
			return '待处理';
		} else if (value == '1') {
			return '自处理';
		} else if (value == '2') {
			return '科室办理';
		} else if (value == '3') {
			return '上报处理';
		} else if (value == '-1') {
			return '未予办理';
		}
	}
	return value;
}

function addToolbar() {
	var tbr = Ext.getCmp(querykey + '_toolbar');

	tbr.addSeparator();

	tbr.addButton({
		text : '来信登记(区)',
		iconCls : 'add',
		scope : this,
		handler : function() {
			window.location.href = context
					+ '/system/objectcreator.do?method=neu&key=APP_LXDJ&type=1&querykey=' + querykey;
		}
	});
}